function LoginCtrl($scope, $http) {

	$scope.login = function() {
		ajaxJSonPost("/YYOA/user/login", true, {
			"userName" : $scope.userName,
			"password" : $scope.password,
			"rememberPwd" : $scope.rememberPwd
		}, function(result) {
			window.location.href = '/YYOA/pc/page' + result.goToPage;
		}, null);
	}

	$scope.verifyUser = function() {
		ajaxJSonPost("/YYOA/user/verifyUser", true, {
			"userName" : $scope.resetUserName,
			"mobilePhoneOrEmail" : $scope.mobilePhoneOrEmail
		}, function(result) {
			if (result) {
				gotoResetPassword();
			} else {
				alert("您输入的用户名和手机号或邮箱不匹配！");
			}
		}, null);
	}

	function gotoResetPassword() {
		show_box('signup-box');
		return false;
	}

	$scope.resetPassword = function() {
		if ($scope.resetPd == null || $scope.resetPd2 == null) {
			alert("密码不能为空，请重新输入！");
		} else if ($scope.resetPd != $scope.resetPd2) {
			alert("两次输入的密码不一样，请重新输入！");
		} else {
			ajaxJSonPost("/YYOA/user/resetPassword", true, {
				"userName" : $scope.resetUserName,
				"resetPassword" : $scope.resetPd
			}, function(result) {
				if (result) {
					window.location.href = '/YYOA/pc/page/login/index.html';
				}
			}, null);
		}
	}
}